﻿@using X.PagedList;
@using X.PagedList.Mvc.Core;
@using FwProject.PrePaymentInfo.Dto
@using X.PagedList.Mvc.Common;
@model List<ReceiptDetailsDto>
@{
    Layout = null;
    int i = 0;
    //if (Model.Count > 0)
    //{
    //    if (Model.PageNumber != 1)
    //    {

    //        i = (Model.PageNumber - 1) * Model.PageSize;
    //    }
    //}
    decimal Sumprice = 0;
    decimal UsePrePayment = 0;
    decimal TaskBackAmount = 0;
    decimal UsePrePaymentSurplus = 0;
    decimal PreferentialAmount = 0;
}
<div>

    <table id="t" class="table table-bordered table-hover table-rowselected">
        <thead>
            <tr>
                <th style="text-align:center;width: 40px;">
                    <div class="i-checks" id="chkDiv">
                        <label class="ibox-tools" id="latd1">
                            <input type="checkbox" id="che" value="">
                        </label>
                    </div>
                </th>
                <th style="width:45px">序号</th>
                <th>状态</th>
                <th>日期</th>
                <th>单号</th>
                <th>餐厅</th>
                <th>账户</th>
                <th>使用预收款金额</th>
                <th>收款金额</th>
                <th>预收款余额</th>
                <th>优惠金额</th>
            </tr>
        </thead>
        <tbody>
            @if (Model.Count == 0)
            {
                <tr><td colspan="11" align="center">暂无数据</td></tr>
            }
            else
            {
                foreach (var item in Model)
                {
                    UsePrePayment += item.UsePrePayment;
                    TaskBackAmount += item.TaskBackAmount;
                    UsePrePaymentSurplus += item.UsePrePaymentSurplus;
                    PreferentialAmount += item.PreferentialAmount;
                    i++;
                    <tr>
                        <td style="text-align:center">
                            <div class="i-checks" data-value="@item.Id">
                                <input type="checkbox" name="che" value="@item.Id"> <i></i>
                            </div>
                        </td>
                        <td>@i</td>
                        <td>@item.ReceiptInfoStatus</td>
                        <td>@item.Dateofreceipt</td>
                        <td><a href="javascript:top.window.openTab(7451,'收款单[@item.ReceiptInfoNumber]','/Receipt/ReceiptDetail?id=@item.Id')">@item.ReceiptInfoNumber</a></td>
                        <td>@item.RestaurantName</td>
                        <td>@item.AccountName</td>
                        <td>@item.UsePrePayment</td>
                        <td>@item.TaskBackAmount</td>
                        <td>@item.UsePrePaymentSurplus</td>
                        <td>@item.PreferentialAmount</td>
                    </tr>
                }
                <tr class="footer">
                    <td colspan="2">合计</td>
                    <td colspan="5"></td>
                    <td>@UsePrePayment</td>
                    <td>@TaskBackAmount</td>
                    <td>@UsePrePaymentSurplus</td>
                    <td>@PreferentialAmount</td>
                </tr>
            }
        </tbody>
    </table>
</div>
@*<div class="row pagedinfo">
        <div class="col-sm-5">
            共 @Model.TotalItemCount 条，@Model.PageSize 条/页 当前第 @Model.PageNumber/@Model.PageCount 页
        </div>
        <div class="col-sm-7">
            @Html.PagedListPager(Model, page => Url.Action("Index", new { pageIdx = page, PaymentNumber = Context.Request.Query["PaymentNumber"] }), PagedListRenderOptions.EnableUnobtrusiveAjaxReplacing(new AjaxOptions() { AllowCache = false, HttpMethod = "Get", UpdateTargetId = "data_list", OnSuccess = "AjaxSuccessCallback", OnBegin = "AjaxBegin" }))
        </div>
    </div>*@


